<template>
	<view>
		<view class="nav">
			<view class="nav-item" v-for="item in navData" :key="item" @tap="navChange(item)">
				<view class="nav-text" :class="{black:item==defulat}">{{item}}(0)</view>
				<view class="middle" v-if="defulat==item"></view>
			</view>
		</view>
		
		<view class="nothing">你暂时无优惠卷</view>
		<view class="receive" @tap="receive">前往领卷中心</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navData:['全部','贷款','财富','保险','钱包'],
				defulat:'全部'
			}
		},
		methods: {
			navChange(item){
				this.defulat=item
			},
			///前往领卷中心
			receive(){
				uni.navigateTo({
					url:'/pages/receivingCenter/receivingCenter'
				})
			}
		}
	}
</script>

<style>
	.nav {
		width: 100%;
		height: auto;
		/* border: 1px solid green; */
		border-bottom: 1rpx solid rgba(0,0,0,0.1);
		display: flex;
	}
	.nav-item{
		width: 100%;
		height: 80rpx;
		text-align: center;
		line-height: 75rpx;
	}
	.nav-text{
		font-size: 26rpx;
		color: rgba(0,0,0,0.6);
	}
	
	.black{
		font-weight: bold;
		color: #000000;
		font-size: 28rpx;
	}
	.middle{
		width: 65rpx;
		height: 6rpx;
		margin: 0rpx auto;
		background-color: #3476fe;
	}
	
	.nothing{
		width: 100%;
		height: auto;
		text-align: center;
		margin: 300rpx auto 30rpx;
		font-size: 26rpx;
		color: rgba(0,0,0,0.6);
	}
	.receive{
		width: 70%;
		height: 80rpx;
		background-color: #3476fe;
		color: #FFFFFF;
		text-align: center;
		line-height: 80rpx;
		border-radius: 50rpx;
		margin: 0rpx auto;
		font-size: 32rpx;
	}
</style>
